package com.zhu.transaction.mapper;

import com.zhu.transaction.pojo.Message;
import com.zhu.transaction.pojo.state.BackState;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zhu
 * @since 2021-01-07
 */
public interface MessageMapper {

    //添加消息
    int addOneMessage(Message message);

    //更新消息状态
    int updateMessageState(@Param("messageId") String messageId, @Param("newState") Integer newState);

    //查询我的消息
    List<Message> queryMessageByReceiveUserId(String userId);

    //查询未读消息数
    Integer unReadMessageCount(String userId);

    //删除一条消息
    int deleteOneMessage(String messageId);
}
